#include "GameWindow.h"
#include "../Engine/GameEngine.h"

GameWindow::GameWindow() {
	this->engine = new GameEngine();
}

GameWindow::~GameWindow() {
}
void GameWindow::initializeGL() {
	init();
}
void GameWindow::paintGL() {
	loop();
	makeCurrent();
	update();
}
void GameWindow::resizeGL(int w, int h) {
	this->engine->getRender()->resize(w, h);
}

void GameWindow::init() {
	this->engine->init();

}
void GameWindow::loop() {
	this->engine->loopGame();
}

void GameWindow::keyPressEvent(QKeyEvent* event) {
	this->engine->keyPressEvent(event);
}
void GameWindow::keyReleaseEvent(QKeyEvent* event) {
	this->engine->keyReleaseEvent(event);
}